package com.seeqool.v1.chartframes;

import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYDotRenderer;

import com.seeqool.v1.datamodel.SQLTable;
import com.seeqool.v1.dataviews.XYView;

public class XYScatterFrame extends BaseChartFrame {
	private static final long serialVersionUID = 1L;

	public XYScatterFrame(SQLTable queryResult, int majorAxis, Integer[] minorAxes) {
		super("Scatter Chart");
		XYDotRenderer FGrenderer = new XYDotRenderer();
		
		FGrenderer.setDotHeight(6);
		FGrenderer.setDotWidth(6);
		//FGrenderer.setSeriesPaint(0, Color.red);

		ValueAxis xaxis = new NumberAxis();
		ValueAxis yaxis = new NumberAxis();
		
		XYPlot plot = new XYPlot(new XYView(queryResult, majorAxis, minorAxes), xaxis, yaxis, FGrenderer);

		this.addContent(new ChartPanel(new JFreeChart(plot)));
	}
}
